package handler;

import java.util.List;

import bean.TypeCD;

import com.google.gson.Gson;

import dao.TypeCDDao;

public class LoadTypesHandler implements IHandler{

	@Override
	public String process() {
		List<TypeCD> types;
		try {
			types = TypeCDDao.getTypeCDs();
		} catch (Exception e) {
			return "Error on getting typeCDs :"+e.getMessage();
		}
		String data = "{\"identifier\": \"id\", \"items\": "+new Gson().toJson(types)+"}";
    	return data;
	}

}
